package edu.gdut.thesissys.vo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Student entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "student", catalog = "gdutmis")
public class Student extends BaseVo implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -4773521174503703232L;
	private String studentId;
	private Major major;
	private String name;
	private String sex;
	private String phone;
	private String email;
	private String classes;
	private String password;
	private Set<StudentChooseTitle> studentChooseTitles = new HashSet<StudentChooseTitle>(
			0);
	private Set<Accreditation> accreditations = new HashSet<Accreditation>(0);
	private Set<Gkdb> gkdbs = new HashSet<Gkdb>(0);
	private Set<Adjust> adjusts = new HashSet<Adjust>(0);
	private Set<AccreditationDebate> accreditationDebates = new HashSet<AccreditationDebate>(
			0);
	private Set<NetTeaching> netTeachings = new HashSet<NetTeaching>(0);
	private Set<MidCheck> midChecks = new HashSet<MidCheck>(0);

	// Constructors

	/** default constructor */
	public Student() {
	}

	/** minimal constructor */
	public Student(String studentId, Major major, String name, String sex,
			String classes, String password) {
		this.studentId = studentId;
		this.major = major;
		this.name = name;
		this.sex = sex;
		this.classes = classes;
		this.password = password;
	}

	/** full constructor */
	public Student(String studentId, Major major, String name, String sex,
			String phone, String email, String classes, String password,
			Set<StudentChooseTitle> studentChooseTitles,
			Set<Accreditation> accreditations, Set<Gkdb> gkdbs,
			Set<Adjust> adjusts, Set<AccreditationDebate> accreditationDebates,
			Set<NetTeaching> netTeachings, Set<MidCheck> midChecks) {
		this.studentId = studentId;
		this.major = major;
		this.name = name;
		this.sex = sex;
		this.phone = phone;
		this.email = email;
		this.classes = classes;
		this.password = password;
		this.studentChooseTitles = studentChooseTitles;
		this.accreditations = accreditations;
		this.gkdbs = gkdbs;
		this.adjusts = adjusts;
		this.accreditationDebates = accreditationDebates;
		this.netTeachings = netTeachings;
		this.midChecks = midChecks;
	}

	// Property accessors
	@Id
	@Column(name = "student_id", unique = true, nullable = false, length = 10)
	public String getStudentId() {
		return this.studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "major_id", nullable = false)
	public Major getMajor() {
		return this.major;
	}

	public void setMajor(Major major) {
		this.major = major;
	}

	@Column(name = "name", nullable = false, length = 20)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "sex", nullable = false, length = 2)
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "phone", length = 11)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "email", length = 30)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "classes", nullable = false, length = 4)
	public String getClasses() {
		return this.classes;
	}

	public void setClasses(String classes) {
		this.classes = classes;
	}

	@Column(name = "password", nullable = false, length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student")
	public Set<StudentChooseTitle> getStudentChooseTitles() {
		return this.studentChooseTitles;
	}

	public void setStudentChooseTitles(
			Set<StudentChooseTitle> studentChooseTitles) {
		this.studentChooseTitles = studentChooseTitles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student")
	public Set<Accreditation> getAccreditations() {
		return this.accreditations;
	}

	public void setAccreditations(Set<Accreditation> accreditations) {
		this.accreditations = accreditations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student")
	public Set<Gkdb> getGkdbs() {
		return this.gkdbs;
	}

	public void setGkdbs(Set<Gkdb> gkdbs) {
		this.gkdbs = gkdbs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student")
	public Set<Adjust> getAdjusts() {
		return this.adjusts;
	}

	public void setAdjusts(Set<Adjust> adjusts) {
		this.adjusts = adjusts;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student")
	public Set<AccreditationDebate> getAccreditationDebates() {
		return this.accreditationDebates;
	}

	public void setAccreditationDebates(
			Set<AccreditationDebate> accreditationDebates) {
		this.accreditationDebates = accreditationDebates;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student")
	public Set<NetTeaching> getNetTeachings() {
		return this.netTeachings;
	}

	public void setNetTeachings(Set<NetTeaching> netTeachings) {
		this.netTeachings = netTeachings;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student")
	public Set<MidCheck> getMidChecks() {
		return this.midChecks;
	}

	public void setMidChecks(Set<MidCheck> midChecks) {
		this.midChecks = midChecks;
	}

}